package com.jlnk.newdemo.view;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.jlnk.newdemo.R;

public class NewsDetailActivity extends AppCompatActivity {
    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.news_detail);

        webView = findViewById(R.id.news_detail_webview);
        webView.setWebViewClient(new WebViewClient());

        String url = getIntent().getStringExtra("NEWS_ITEM_URL");
        if (url != null) {
            webView.loadUrl(url);
        } else {
            Toast.makeText(this, "新闻详情数据为空", Toast.LENGTH_SHORT).show();
        }
    }
}